<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%	
	//获取项目名
	String path = request.getContextPath();
	//获取tomcat 协议+地址+端口号+ 获取项目名
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	//out.println(basePath);
%>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>用户资源管理后台</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath %>background/static/admin/layui/css/layui.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath %>background/static/admin/css/admin.css" />
</head>

<body>
	<%
			Object messageList =session.getAttribute("messageList");
			pageContext.setAttribute("messageList",messageList); 
		%>

	<div class="page-content-wrap">
		<form class="layui-form" action="">
			<div class="layui-form-item">
				<div class="layui-inline tool-btn">
					<!-- <button class="layui-btn layui-btn-small layui-btn-normal addBtn hidden-xs" data-url="menu-add2.html">删除<i class="layui-icon">&#xe654;</i></button> -->
					<!-- <button class="layui-btn layui-btn-small layui-btn-warm listOrderBtn hidden-xs" data-url="/admin/category/listorderall.html"><i class="iconfont">&#xe656;</i></button> -->
				</div>
				<div class="layui-inline">
					<input type="text" name="title" placeholder="请输入标题"
						autocomplete="off" class="layui-input">
				</div>

				<button class="layui-btn layui-btn-normal" lay-submit="search">搜索</button>
			</div>
		</form>
		<div class="layui-form" id="table-list">
			<table class="layui-table" lay-even lay-skin="nob">
				<colgroup>
					<col width="50">
					<col width="70">
					<col width="150">
					<col width="550">
					<col width="50">
					<col width="35">
					<col width="50">
					<col width="50">
					<col width="50">
					
				</colgroup>
				<thead>
					<tr>
						<th><input type="checkbox" name="" lay-skin="primary"
							lay-filter="allChoose"></th>
						<th>资讯id</th>
						<th>资讯标题</th>
						<th>内容</th>
						<th>点赞数</th>
						<th>收藏数</th>
						<th>评论数</th>
						<th>举报数</th>
						<th>发布者id</th>
						
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${messageList}" var="m">
						<tr>
							<td><input type="checkbox" name="" lay-skin="primary"
								data-id="1"></td>
							<td>${m.mid}</td>
							<td>${m.mTitle}</td>
							<td>${m.mContent}</td>
							<td>${m.mLoveNum}</td>
							<td>${m.mForkNum}</td>
							<td>${m.mCommentNum}</td>
							<td>${m.mReportNum}</td>
							<td>${m.userid}</td>
							

							<td>
								<div class="layui-inline">

									<button
										class="layui-btn layui-btn-mini layui-btn-normal  go-btn">
										<a
											href="<%=basePath%>background/ordUserJs/index/questionAdd.jsp"><i
											class="layui-icon">&#xe654;</i></a>
									</button>
									

									<button
										class="layui-btn layui-btn-mini layui-btn-normal  go-btn">
										<a
											href="<%=basePath%>background/ordUserJs/index/collegeModify.jsp?&collegeid=${c.collegeid}&collegeName='${c.collegeName}'&collegeProvince=${c.collegeProvince}&collegeLogo='${c.collegeLogo}'"><i
											class="layui-icon">&#xe642;</i></a>
									</button>

									<button
										class="layui-btn layui-btn-mini layui-btn-normal  go-btn">
										<a
											href="<%=basePath%>background/ordUserJs/index/MessageCommentDel.jsp"><i
											class="layui-icon">&#xe640;</i></a>
									</button>

								</div>
							</td>

						</tr>

					</c:forEach>

				</tbody>
			</table>
		</div>
	</div>



	<script type="text/javascript">
			$("#delRs").click(function(){
				alert("ok");
				var rsId = ${bp.rsId};
				console.log(rsId)
				if(confirm("确实要删除吗？")){
                    alert("已经删除！");
                  <%--   $.ajax({
    					url:"<%=basePath %>backgroundServlet",
    					type:"get",
    					data:"mark=delRs&userId="+rsId,
    					dataType:"json",
    					
    				}); --%>
    				
                }else {
                    alert("已经取消了删除操作");
                }
				
				
			});		
		</script>

	<script src="<%=basePath %>background/static/admin/layui/layui.js"
		type="text/javascript" charset="utf-8"></script>
	<script src="<%=basePath %>background/static/admin/js/common.js"
		type="text/javascript" charset="utf-8"></script>
	<script>
			layui.use(['form', 'jquery', 'layer', 'dialog'], function() {
				var $ = layui.jquery;

				//修改状态
				$('#table-list').on('click', '.table-list-status', function() {
					var That = $(this);
					var status = That.attr('data-status');
					var id = That.parent().attr('data-id');
					if(status == 1) {
						That.removeClass('layui-btn-normal').addClass('layui-btn-warm').html('隐藏').attr('data-status', 2);
					} else if(status == 2) {
						That.removeClass('layui-btn-warm').addClass('layui-btn-normal').html('显示').attr('data-status', 1);

					}
				})

			});
		</script>
</body>

</html>